package priv.lhy.activity.util;

import priv.lhy.activity.dal.entity.ActDrawAward;
import priv.lhy.activity.draw.bean.ActivityTurntableDrawReq;
import priv.lhy.activity.services.processor.constants.DrawContants;

/**
 * author : lihy
 * date : 2019/2/16 10:04
 */
public class RedisKeyManager {

    /**
     * 正在抽奖的key
     *
     * @param requset
     * @return
     */
    public static String getDrawingRedisKey(ActivityTurntableDrawReq requset) {
        return DrawContants.DRAWING_PREFIX + String.valueOf(requset.getUid());
    }

    /**
     * 奖项对应的奖品key
     *
     * @param actDrawAward
     * @return
     */
    public static String getAwardRedisKey(ActDrawAward actDrawAward) {
        return DrawContants.DRAW_AWARD + actDrawAward.getAwardType() + ":" + actDrawAward.getId();
    }
}
